<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <meta name="viewport"
    content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
  <title>打印收据</title>
  <link rel="stylesheet" href="__CDN__/print/index.print.css?v=20240705" />
  <link rel="stylesheet" href="__STATIC__/outer/render.style.css?t=20220129">
  <style type="text/css">
    .el-form .el-form-item__label {
      color: black !important;
    }
    .el-form .el-input__inner {
      color: black !important;
      border: none;
      border-bottom: 1px solid black !important;
    }
    .el-form .el-textarea__inner {
      color: black !important;
      border: none;
      border-bottom: 1px solid black !important;
    }
    .total-money .el-input__inner{
      font-size: 36px;
      height: 40px;
      border: none;
    }
  </style>
</head>
<body>

  <div id="app" style="width: 617px; font-family: 'FangSong_GB2312'; color: black !important; margin-left: 120px">
    <v-form-render
      :form-json="formJson"
      :form-data="formData"
      :option-data="optionData"
      ref="vFormRef"
      :style="'{font-family: FangSong_GB2312, color: black !important}'"
    >
    </v-form-render>
  </div>

  <script src="__STATIC__/outer/vue.global.min.js"></script>
  <script src="__STATIC__/outer/index.full.min.js"></script>
  <script src="__STATIC__/outer/render.umd.js?t=20220129"></script>
  <script type="text/javascript" src="__STATIC__/js/vform.js?{if $Think.env.app_debug}_={:time()}{else /}v={$Think.config.tpadmin.version}{/if}"></script>
  <!-- axios -->
  <script src="__STATIC__/js/axios.min.js"></script>
  <script type="text/javascript"
    src="__STATIC__/js/main.js?{if $Think.env.app_debug}_={:time()}{else /}v={$Think.config.tpadmin.version}{/if}"></script>
  <script>
    let that = this
    axiosGet("/admin/house.uncollected/queryData", { id: '{$id}' }).then(response => {
      if (response.code == 1) {
        let formJsonData = response.data.end_time ? formJson : formJson1;
        const { createApp } = Vue;
        const app = createApp({
          data() {
            return {
              formJson: formJsonData,
              formData: response.data,
              optionData: {}
            }
          },
        });
        app.use(ElementPlus)
        app.use(VFormRender)
        app.mount("#app");
        window.print()
      } else {
        if (response.msg) {
                that.$message({
                  message: response.msg, type: response.state
                });
                return
              }
              that.$message.error('系统出错了 !!!');
      }
    });

    var afterPrint = function () {
      window.close()
    };
    if (window.matchMedia) {   //返回一个新的 MediaQueryList 对象，表示指定的媒体查询字符串解析后的结果。
      var mediaQueryList = window.matchMedia('print');
      mediaQueryList.addListener(function (mql) {
        if (!mql.matches) {
          afterPrint();
        }
      });
    }
    window.onafterprint = afterPrint;
  </script>
</body>

</html>
